﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MPPIT
{
    public partial class ScheduleForm : Form
    {
        public ScheduleForm()
        {
            InitializeComponent();
        }
        public string ScheduleName
        {
            get { return textBoxName.Text; }
            set { textBoxName.Text = value; }
        }
        public string Time
        {
            get { return maskedTextBoxTime.Text; }
            set { maskedTextBoxTime.Text = value; }
        }
        public bool EnableStatus
        {
            get { return checkBoxEnable.Checked; }
            set { checkBoxEnable.Checked = value; }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            bool valid = true;
            if (ScheduleName.Trim() == "")
            {
                valid = false;
                MessageBox.Show("Please fill schedule name");
            }
            if (Time.Split(':')[0].Trim() == "" || Time.Split(':')[1].Trim() == "")
            {
                valid = false;
                MessageBox.Show("Please fill schedule time");
            }
            if(valid)
                DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }
    }
}
